<meta charset="utf-8" />
<div class="pophead_xk skyblue"><span><span><img src="img/u6.png"></span><span>新增车辆类型</span></span><i><img src="img/close.png" alt="" /></i></div>
<div class="popbody_xk  noborder gray1">
	<table cellspacing="0" class="poptable2_xk poptable2_xk_zyl">
		<tbody>
			<tr>
				<th>车辆类型名称：</th>
				<td><input type="text" class="search" /></td>
			</tr>
			<tr>
				<th>容积（立方米）：</th>
				<td><input type="text" class="search" /></td>
			</tr>
			<tr>
				<th>长*宽*高（米）：</th>
				<td><input type="text" class="search" /></td>
			</tr>
			<tr>
				<th>载重（吨）：</th>
				<td><input type="text" class="search" /></td>
			</tr>
		</tbody>
		<tfoot>
			<tr>
				<td class="popcomfirm_xk" colspan="2">
					<a class="button blue save">保存</a>
					<a class="button orange">放弃</a>
				</td>
			</tr>
		</tfoot>
	</table>
</div>
<script>
	function insertModelInfo() {
		$(".popcomfirm_xk .save").click(function() {
			data_json = {
				"desc": $(".poptable2_xk_zyl tbody tr:eq(0) td input").val(),
				"bulk": $(".poptable2_xk_zyl tbody tr:eq(1) td input").val(),
				"lwh": $(".poptable2_xk_zyl tbody tr:eq(2) td input").val(),
				"capacity": $(".poptable2_xk_zyl tbody tr:eq(3) td input").val()
			};
			switch("") {
				case data_json["desc"]:
					alert("车辆类型不能为空！");
					break;
				case data_json["bulk"]:
					alert("容积(立方米)不能为空！");
					break;
				case data_json["lwh"]:
					alert("长*宽*高(米)不能为空！");
					break;
				case data_json["capacity"]:
					alert("载重(吨)不能为空！");
					break;
				default:
					$.ajax(config.url + "model/insertModelInfo", {
						data: data_json,
						dataType: "json",
						type: "POST",
						timeout: 10000,
						success: function(data) {
							//console.log(data.success);
							alert(data.msg);
							
							$("popwindow_xk .popup_xk").html("");
							$(".popwindow_xk").css("visibility", "hidden");
							selectModelInfoAll();
						}
					});
					
					break;
			}

		});
	}
	insertModelInfo();
</script>